<?php

namespace Trawind\Basics\Enums;


abstract class BaseEnumerate
{

    const MESSAGE_MAP = [];


    /**
     * @param int $code
     * @return string
     */
    public static function getMessage(int $code): string
    {
        return static::MESSAGE_MAP[$code];
    }


    /**
     * @param $name
     * @param $arguments
     * @return string
     */
    public static function __callStatic($name, $arguments)
    {
        return static::MESSAGE_MAP[constant('static::' . $name)];
    }
}
